#!/usr/bin/env python
#coding=utf-8
import sys
sys.path.append("..")
import FIGModule

class Connect:
	def __init__(self):
		self.__figList = FIGModule.FigList()

		#read all CSV Files in a folder
		######################################################################################
		folderPath = "E:\\MITagger\\MITagger-searchEngine\\resource\\CSV"
		print "***************simulating the process of database***************"
		print "reading all CSV Files..."
		self.__figList.readCSVInFolder(folderPath)
		print "CSV Files index import finished!"
		print "***************process of database finished!***************"
		"""
		for data in figIndexList.getFigIndexList():
			print data.getFigFileName()
		"""
		######################################################################################

	def getFigCaption(self, figFilename):
		for fig in self.__figList.getFigList():
			if fig.getFilename() == figFilename:
				return fig.getCaption()
		return 0